home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 7 Oct 1998
- // Author: mgr
- //
- // Procedure Name:
- // rebuildCurveSetup
- //
- // Description:
- // Update the state of the option box UI to reflect the option values.
- //
- // Input Arguments:
- // parent - Top level parent layout of the option box UI.
- // Required so that UI object names can be
- // successfully resolved.
- //
- // forceFactorySettings - Whether the option values should be set to
- // default values.
- //
- // Return Value:
- // None.
- //
-
- global proc rebuildCurveSetup(string $parent, int $forceFactorySettings)
- {
- setParent $parent;
-
- // Query the optionVar's and set the values into the controls
- //
- int $rebuildType = `optionVar -query rebuildCurveType` + 1;
- int $numSpans = `optionVar -query rebuildCurveTypeUniformNumSpans`;
- int $degree = `optionVar -query rebuildCurveTypeUniformDegree`;
- int $keepRange = `optionVar -query rebuildCurveKeepRange`;
- int $endKnots = `optionVar -q rebuildCurveEndKnots`;
- int $keepControlPoints = `optionVar -query rebuildCurveKeepControlPoints`;
- int $keepEndPts = `optionVar -query rebuildCurveKeepEndPoints`;
- int $keepTan = `optionVar -query rebuildCurveKeepEndTangents`;
- int $keepNumSpans = `optionVar -query rebuildCurveKeepNumSpans`;
- int $useGlobalTol = `optionVar -query rebuildCurveUseGlobalTolerance`;
- radioButtonGrp -e -select (2 - $useGlobalTol) toleranceRadioButtonGrp;
-
- float $localTol = `optionVar -query rebuildCurveLocalTolerance`;
- int $keepOriginal = `optionVar -query rebuildCurveKeepOriginal`;
-
- // Set the controls
- //
- if( $rebuildType == 1 || $rebuildType == 2 || $rebuildType == 3 )
- radioButtonGrp -edit -select $rebuildType rebuildTypeRadioGroup1;
- else if( $rebuildType == 4 || $rebuildType == 5 ) {
- int $temp = $rebuildType - 3;
- radioButtonGrp -edit -select $temp rebuildTypeRadioGroup2;
- } else {
- int $temp = $rebuildType - 5;
- radioButtonGrp -e -select $temp rebuildTypeRadioGroup3;
- }
- intSliderGrp -edit -value $numSpans numSpansIntSliderGrp;
-
- switch($degree) {
- case 1: radioButtonGrp -e -select 1 rebuildCrvDegree123; break;
- case 2: radioButtonGrp -e -select 2 rebuildCrvDegree123; break;
- case 3: radioButtonGrp -e -select 3 rebuildCrvDegree123; break;
- case 5: radioButtonGrp -e -select 1 rebuildCrvDegree57; break;
- case 7: radioButtonGrp -e -select 2 rebuildCrvDegree57; break;
- default: radioButtonGrp -e -select 3 rebuildCrvDegree123; break;
- }
-
- radioButtonGrp -e -select ($endKnots+1) endKnotsRadioButtonGrp;
- radioButtonGrp -edit -select ($keepRange+1) keepRangeRadioButtonGrp;
- checkBoxGrp -edit -value1 $keepEndPts keepCheckBoxGrp;
- checkBoxGrp -edit -value2 $keepTan keepCheckBoxGrp;
- checkBoxGrp -edit -value3 $keepControlPoints keepCheckBoxGrp;
- checkBoxGrp -edit -value4 $keepNumSpans keepCheckBoxGrp;
- radioButtonGrp -edit -select $useGlobalTol toleranceRadioButtonGrp;
- floatSliderGrp -edit -value $localTol localTolFloatFieldGrp;
-
- if( `checkBoxGrp -q -exists keepOriginalCheckBox` ) {
- checkBoxGrp -edit -value1 $keepOriginal keepOriginalCheckBox;
- }
-
- rebuildCurveVisibility $parent -1 $rebuildType $keepControlPoints
- $keepNumSpans;
- }
-